import time

import allure
from page_object.page_roncoo_pay_login import PageLogin
from page_element.el_Roncoo import *
import logging



class AddUserPayConfig(PageLogin):
    """添加用户支付配置"""

    def page_add_adduserpayconfig(self, fx):
        # 前置条件：已登录
        # self.page_login('admin', '123456')
        with allure.step("点击支付管理"):
            self.click(payconfig_manage2.pay_manage)
        with allure.step("点击用户支付配置"):
            self.click(payconfig_manage2.user_pay_config)
        with allure.step("点击添加支付配置按钮"):
            self.click(payconfig_manage2.add_payconfig_btn)
        with allure.step("点击放大镜找用户"):
            self.click(payconfig_manage2.payconfig_user_magnifier_tb)
        with allure.step("点击查找带回用户编号、用户名称"):
            self.click(payconfig_manage2.payconfig_findback_user)
        with allure.step("点击放大镜找产品"):
            self.click(payconfig_manage2.payconfig_product_magnifier_tb)
        with allure.step("点击查找带回产品编号、产品名称"):
            self.click(payconfig_manage2.payconfig_findback_product)
        with allure.step("输入风险与存期"):
            self.send_keys(payconfig_manage2.fx_inp, fx)
        with allure.step("点击提交"):
            self.click(payconfig_manage2.payconfig_tj_btn)

        # # 断言
        # with allure.step("验证新增的用户名"):
        #     dy = self.text(payconfig_manage.dy_payconfig_username_text)
        #     assert '刘北' in dy, '断言失败(添加用户失败)'
        #     print(f'断言的内容:刘北-在-{dy}')
        #     logging.info(f'断言的内容:刘北-在-{dy}')





